import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import HomeRecommend from '../views/HomeRecommend.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'home',
        component: HomeView,
        children: [
            {
                path: '',
                name: 'recommend',
                component: HomeRecommend
            },
            {
                path: 'hot',
                name: 'hot',
                component: () => import('../views/HomeHot.vue')
            },
            {
                path: 'search',
                name: 'search',
                component: () => import('@/views/HomeSearch.vue')
            },
        ]
    },
    {
        path: '/play',
        name: 'play',
        component: () => import('@/views/PlayList.vue')
    },
    {
        path: '/song',
        name: 'song',
        component: () => import('@/views/PlayView.vue'),
        meta: { showPlayBar: false, isChangeRoute: true},
    },
]

const router = new VueRouter({
    routes
})

export default router
